package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.IMessageProvider;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 消息驱动生产者消息发送接口
 *
 * @author Tu
 * @date 2023/11/2 17:37
 */
@RestController
@RequestMapping("api/v1")
public class SendMessageController {

    @Resource
    private IMessageProvider iMessageProvider;

    /**
     * 发送消息并返回流水号
     *
     * @return
     */
    @GetMapping("/sendMessage")
    public String sendMessage() {
        return iMessageProvider.send();
    }

}
